home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Amiga_Mail_Vol2 / Archives / Plain / so90 / Icon1of2.txt next >
Encoding:
Text File  |  1990-10-24  |  2.5 KB  |  52 lines

  1. (c)  Copyright 1990 Commodore-Amiga, Inc.   All rights reserved.
  2. The information contained herein is subject to change without notice,
  3. and is provided "as is" without warranty of any kind, either expressed
  4. or implied.  The entire risk as to the use of this information is
  5. assumed by the user.
  6.  
  7.  
  8.  
  9. Obtaining an Icon Image
  10.  
  11. By David N. Junod
  12.  
  13. One of the many improvements made to Workbench for release 2.0 lies in
  14. its ability to supply an application with arguments from Workbench.
  15. Prior to release 2.0, the only Workbench supported way an application
  16. could receive Workbench arguments was through the Workbench startup
  17. message.  Now, Workbench arguments can come from many sources
  18. including AppWindows, AppIcons, and the ASL file requester.  These
  19. enhancements have made processing Workbench arguments more beneficial
  20. than ever.
  21.  
  22. When an application is started via Workbench, the application receives
  23. a startup message (struct WBStartup) from Workbench.  This message
  24. contains a pointer to an array of WBArg structures.  The array of
  25. WBArgs corresponds to all Workbench icons that were selected at the
  26. time the application was launched.  Each WBArg structure contains a
  27. file lock on the file or directory associated with each icon, as well
  28. as the name associated with the icon.  A WBArg supplies the link to
  29. the icon, or the DiskObject, itself, from which necessary information,
  30. such as application or project ToolTypes, can be extracted.
  31.  
  32. Under release 2.0, Workbench supplies WBArgs using several different
  33. structures.  The structure used depends on the source of the WBArgs.
  34. When it launches an application, Workbench sends the application
  35. WBArgs through the WBStartup structure.  AppWindows and AppIcons use
  36. the AppMessage structure to send WBArgs.  The ASL file requester
  37. provides the arguments in the FileRequester structure.
  38.  
  39. Also with release 2.0, it is possible that icons passed to an
  40. application do not have an .info file associated with them.  Workbench
  41. can now display all files and directories iconically, not just those
  42. with .info files.  For icons without .info files, Workbench supplies a
  43. default icon based on the protection bits and object type (file, dir,
  44. etc.) so the user can manipulate files and directories from Workbench.
  45.  
  46. The following routine uses GetDiskObjectNew() which should be used
  47. only when an application requires an image for every Workbench
  48. argument, whether actual or default.  To only read actual icons and
  49. tooltypes, modify the routine to use GetDiskObject() instead.  For
  50. more information, see the release 2.0 Autodocs.
  51.  
  52.